package licode.unisop.types.dp;

import java.util.HashMap;
import java.util.Map;

public class AusUserProps {
    private Map<String, AusPlatformProp> ps;

    public AusUserProps() {
        ps = new HashMap<>();
    }

    public void removeEmpty() {
        if (null != ps) {
            if (ps.size() == 0) {
                ps = null;
            } else {
                Map<String, AusPlatformProp> plTmp = new HashMap<>();
                ps.forEach((key, item) -> {
                    item.removeEmpty();
                    if (!item.isEmpty()) {
                        plTmp.put(key, item);
                    }
                });
                ps.clear();
                ps.putAll(plTmp);
            }
        }
    }

    public Map<String, AusPlatformProp> getPs() {
        return ps;
    }

    public void setPs(Map<String, AusPlatformProp> ps) {
        this.ps = ps;
    }
}
